package com.yst.webplugin.annotation;

public enum Symbol {
    /**
     * equal
     */
    EQ("="),
    /**
     * not equal
     */
    NOT_EQ("<>"),
    /**
     * in scope
     */
    IN("in"),
    /**
     * between
     */
    BETWEEN("between"),
    /**
     * like
     */
    LIKE("like"),
    /**
     * less than
     */
    LESS("<"),
    /**
     * less than or equal
     */
    LESS_EQ("<="),
    /**
     * more than
     */
    MORE(">"),
    /**
     * more than or equal
     */
    MORE_EQ(">="),
    /**
     * determine null
     */
    IS_NULL("is null"),
    /**
     * determine not null
     */
    IS_NOT_NULL("is not null");

    public final String symbol;

    Symbol(String symbol){
        this.symbol=symbol;
    }

    public static Symbol fromString(String symbol){
        for(Symbol conditionSymbol: Symbol.values()){
            if (conditionSymbol.symbol.equals(symbol)){
                return conditionSymbol;
            }
        }
        return Symbol.EQ;
    }

}
